package com.wjh.mirna.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wjh.mirna.http.Response;
import com.wjh.mirna.model.Diseases;
import com.wjh.mirna.model.Score;
import com.wjh.mirna.service.impl.DiseasesServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/diseases")
public class DiseasesController {
    @Autowired
    DiseasesServiceImpl diseasesService;
    @GetMapping("/allDiseases")
    public Response queryDiseases(int pageNum, int size, Diseases diseases){
        Page page = new Page<>(pageNum, size);
        Page page1 = diseasesService.selectDnameAndScoreByPage(page, diseases);
        return Response.ok(page1);
    }
}
